// 文件名：首页
// * 作者：ZQK
// * 描述：〈描述〉
// * 修改人：ZQK
// * 修改时间：2025-1-7
import http from '../http'

export type detailData = {
	id: string
}

// 登录
function wxLogin(data: any) {
	return http.post('/mini/login', data)
}

// 用户信息
function getInfo() {
	return http.get('/app/getInfo')
}

// 修改用户头像和昵称
function UpdateUser(data: any) {
	return http.put('/system/user/UpdateUser', data)
}

// 申请成为合伙人
function applyPartner(data: any) {
	return http.post('/wx/leader/record/apply', data)
}

// 获取邀请码-邀请用户
function getInvitationCodeByUser() {
	return http.get('/user/invitation/code/getInvitationCodeByUser?outTime=123')
}

// 获取邀请码-邀请团员
function getInvitationCodeByTeammate() {
	return http.get('/user/invitation/code/getInvitationCodeByTeammate?outTime=123')
}

// 加入团队
function addTeam(code: any) {
	return http.post('/user/invitation/code/addTeam?invitationCode='+code)
}

// 获取用户余额信息
function getUserBalance() {
	return http.get('/system/history/getUserBalance')
}

// 获取我的用户列表
function getMyUserList(data: any) {
	return http.get('/system/user/getMyUserList', {
		params: data
	})
}

// 获取用户收益记录
function getUserRevenueList(data: any) {
	return http.get('/system/history/getUserRevenueList', {
		params: data
	})
}

// 获取团员余额信息
function getTeamBalance() {
	return http.get('/system/history/getTeamBalance')
}

// 获取我的团员列表
function getMyTeammateList(data: any) {
	return http.get('/system/user/getMyTeammateList', {
		params: data
	})
}

// 获取用户团员收益记录
function getUserTeamRevenueList(data: any) {
	return http.get('/system/history/getUserTeamRevenueList', {
		params: data
	} )
}

// 活动配置
function getSettingInfo() {
	return http.get('/app/setting/getInfo')
}

// 获取系统设置详细信息
function getSystemInfo() {
	return http.get('/system/setting')
}

// 新增意见反馈
function feedback(data: any) {
	return http.post('/system/feedback', data)
}

// 获取通知列表
function getNoticeList(data: any) {
	return http.get('/system/notice/list', {
		params: data
	})
}

// 根据通知公告编号获取详细信息
function getNoticeDetail(data: any) {
	return http.get('/system/notice/' + data)
}
export default {
	wxLogin,
	getInfo,
	UpdateUser,
	applyPartner,
	getInvitationCodeByUser,
	getInvitationCodeByTeammate,
	addTeam,
	getUserBalance,
	getMyUserList,
	getUserRevenueList,
	getTeamBalance,
	getMyTeammateList,
	getUserTeamRevenueList,
	getSettingInfo,
	getSystemInfo,
	feedback,
	getNoticeList,
	getNoticeDetail,
}
